/*
 * Copyright (C) 2009 Leandro Aparecido <lehphyro@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.metalframework.samples.petclinic;

import java.util.*;

import javax.persistence.*;
import javax.validation.constraints.*;

import org.codehaus.jackson.annotate.*;
import org.metalframework.validation.constraints.*;

@Entity
public class Visit extends IdentifiedEntity {

	private static final long serialVersionUID = 2951249358650508760L;

	private Date date;
	
	private String description;
	
	private Pet pet;

	public Visit() {
		this(null, null, null);
	}
	
	public Visit(Date date, String description, Pet pet) {
		this.date = date;
		this.description = description;
		this.pet = pet;
	}
	
	@NotNull
	@Temporal(TemporalType.DATE)
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@NotNull @NotBlank
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne
	@JsonIgnore
	public Pet getPet() {
		return pet;
	}

	public void setPet(Pet pet) {
		this.pet = pet;
	}
	
}
